<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!--最好是创建一个纯净的html文件，不然会报错-->
<head>
  <title>Reading List</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- 引入 Bootstrap -->
  <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
  <!-- jQuery (Bootstrap 的 JavaScript 插件需要引入 jQuery) -->
  <script src="https://code.jquery.com/jquery.js"></script>
</head>
<body>
<div class="container">
  <!--引用定义好的页尾模板:headercontext-->
  <div th:include="header :: headercontext"></div>
  <div class="row clearfix">
    <div class="col-md-12 column">
      <div class="page-header">
        <h1>图书列表
          <small>显示当前图书库存信息</small>
        </h1>
      </div>
    </div>
  </div>
  <div class="row clearfix">
    <div class="col-md-12 column">
      <table class="table table-hover table-striped">
        <thead>
        <tr>
          <th>图书编号</th>
          <th>图书名字</th>
          <th>图书数量</th>
          <th>操作</th>
        </tr>
        </thead>
        <!--判断是否为空-->
        <tbody th:unless="${#lists.isEmpty(books)}">
          <!--循环-->
          <tr th:each="book : ${books}">
            <td th:text="${book.bookId}"></td>
            <td th:text="${book.name}"></td>
            <td th:text="${book.number}"></td>
            <td>
              <!--拼接URL，占坑填上即可，避免加号拼接-->
              <a th:href="@{/book/detail/{bookId} (bookId=${book.bookId})}">详情</a> |
              <a th:href="@{/book/del/{bookId} (bookId=${book.bookId})}">删除</a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <!--引用定义好的页尾模板:copyright-->
    <div th:include="footer :: copyright (2011,2017)"></div>
  </div>
</div>
</body>
</html>